/**
 * Project Name:mauto-web
 * File Name:TechnicianBizImpl.java
 * Package Name:com.mingsoft.technician.biz.impl
 * Date:2017年6月14日上午9:37:29
 * Copyright (c) 2017, inf-technology Co., Ltd. All Rights Reserved.
 *
*/

package com.inftech.mauto.jy.service.impl;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.inftech.mauto.jy.dao.TechnicianDao;
import com.inftech.mauto.jy.entity.Technician;
import com.inftech.mauto.jy.service.TechnicianService;

/**
 * ClassName:TechnicianBizImpl <br/>
 * Function: TODO ADD FUNCTION. <br/>
 * Date: 2017年6月14日 上午9:37:29 <br/>
 * 
 * @author Administrator
 * @version
 * @since JDK 1.7
 */
@Service(value = "technicianBizImpl")
public class TechnicianServiceImpl implements TechnicianService {
	/**
	 * 技师javaDao
	 */
	@Resource(name = "technicianDao")
	private TechnicianDao technicianDao;

	/**
	 * 
	 * TODO 获取技师列表（可选）.
	 * 
	 * @see com.inftech.mauto.jy.service.TechnicianService#getTechnicianList(java.util.Map)
	 */
	@Override
	public List<Technician> getTechnicianList(Map<String, Object> map) {
		return technicianDao.getTechnicianList(map);
	}

	/**
	 * 
	 * TODO 获取技师总数（可选）.
	 * 
	 * @see com.inftech.mauto.jy.service.TechnicianService#getTechnicianListCount(java.util.Map)
	 */
	@Override
	public int getTechnicianListCount(Map<String, Object> map) {

		return technicianDao.getTechnicianListCount(map);
	}

	/**
	 * 
	 * TODO 增加技师（可选）.
	 * 
	 * @see com.inftech.mauto.jy.service.TechnicianService#insertTechnician(java.util.Map)
	 */
	@Override
	public void insertTechnician(Map<String, Object> map) {

		technicianDao.insertTechnician(map);
	}

	/**
	 * 
	 * TODO 删除技师（可选）.
	 * 
	 * @see com.inftech.mauto.jy.service.TechnicianService#deleteAll(java.util.List)
	 */
	@Override
	public int deleteAll(List<String> list) {

		return technicianDao.deleteAll(list);
	}

	/**
	 * 
	 * TODO 根据企业id 获取技师列表（可选）.
	 * 
	 * @see com.inftech.mauto.jy.service.TechnicianService#getTechnicianlistById(java.lang.String)
	 */
	@Override
	public List<Technician> getTechnicianlistById(String companyId) {

		return technicianDao.getTechnicianlistById(companyId);
	}

	/**
	 * 
	 * TODO 获取单个技师对象（可选）.
	 * 
	 * @see com.inftech.mauto.jy.service.TechnicianService#getTechnicianById(java.lang.String)
	 */
	@Override
	public Technician getTechnicianById(String id) {

		return technicianDao.getTechnicianById(id);
	}

	/**
	 * 
	 * TODO 更新技师信息（可选）.
	 * 
	 * @see com.inftech.mauto.jy.service.TechnicianService#updateById(java.util.Map)
	 */
	@Override
	public int updateById(Map<String, Object> map) {

		return technicianDao.updateById(map);
	}

	/**
	 * 
	 * TODO 重置技师密码（可选）.
	 * 
	 * @see com.inftech.mauto.jy.service.TechnicianService#updatePWD(java.util.Map)
	 */
	@Override
	public int updatePWD(Map<String, Object> map) {

		return technicianDao.updatePWD(map);
	}

	@Override
	public int getCountByTel(String phone) {

		return technicianDao.getCountByTel(phone);
	}

	/**
	 * 
	 * TODO 根据企业id 获取每个企业id 对应的技师总数（可选）.
	 * 
	 * @see com.inftech.mauto.jy.service.TechnicianService#getCountByCompanyId(java.util.List)
	 */
	@Override
	public List<Map<String, Object>> getCountByCompanyId(List<String> List) {

		return technicianDao.getCountByCompanyId(List);
	}

	/**
	 * 
	 * TODO 根据phone 获取技师对象 实现登录功能（可选）.
	 * 
	 * @see com.inftech.mauto.jy.service.TechnicianService#getTechnicianByPhone(java.lang.String)
	 */
	@Override
	public Technician getTechnicianByPhone(String phone) {

		return technicianDao.getTechnicianByPhone(phone);
	}

	@Override
	public int updateByPhone(String phone, String token) {

		return technicianDao.updateTokenByPhone(phone, token);
	}

	@Override
	public int updatePwdAndTokenByphone(Map<String, Object> map) {

		return technicianDao.updatePwdAndTokenByphone(map);
	}

	@Override
	public int updatePwdAndTokenByToken(Map<String, Object> map) {

		return technicianDao.updatePwdAndTokenByToken(map);
	}

	@Override
	public String getPhoneByToken(String token) {

		return technicianDao.getPhoneByToken(token);
	}

	@Override
	public int getJSIdByToken(String token) {

		return technicianDao.getJSIdByToken(token);
	}

}
